/*
 * @Date: 2023-03-20 19:56:04
 * @LastEditors: Chuying
 * @LastEditTime: 2023-04-03 13:57:37
 * @Description:
 */
import { Controller, Get, Post, Body, Inject } from '@nestjs/common';
import { CategoryService } from './category.service';
import { CreateCategoryDto } from './dto/create-category.dto';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('分类')
@Controller('category')
export class CategoryController {
  constructor(
    private readonly categoryService: CategoryService,
    private readonly categoryEnum: CategoryService, // @Inject('CS') private readonly categoryService: CategoryService, // @Inject('CategoryEnum') private readonly categoryEnum: CategoryService,
  ) {}

  @Post('add')
  create(@Body() createCategoryDto: CreateCategoryDto) {
    return this.categoryService.create(createCategoryDto);
  }

  @Get('list')
  findAll() {
    // return this.categoryEnum;
    return this.categoryService.findAll();
  }
}
